package o;

import android.content.Context;

public class avl extends avi {
    private volatile avk ˊ;
    private final Object ˋ = new Object();
    private final Context ˎ;
    private avj ˏ;

    public avl(Context context) {
        this.ˎ = context;
    }

    public String ˊ(String str) {
        return ˋ(str, null);
    }

    public String ˋ(String str, String str2) {
        if (str == null) {
            throw new NullPointerException("path must not be null.");
        }
        if (this.ˊ == null) {
            synchronized (this.ˋ) {
                if (this.ˊ == null) {
                    if (this.ˏ != null) {
                        this.ˊ = new avm(this.ˏ.ˊ());
                        this.ˏ.ˏ();
                        this.ˏ = null;
                    } else {
                        this.ˊ = new avo(this.ˎ);
                    }
                }
            }
        }
        return this.ˊ.ˎ(ˎ(str), str2);
    }

    private static String ˎ(String str) {
        int i = 0;
        if (str.length() > 0) {
            while (str.charAt(i) == '/') {
                i++;
            }
        }
        return '/' + str.substring(i);
    }
}
